package com.laolei.test.api;

import org.springframework.web.bind.annotation.RequestParam;

import com.fasterxml.jackson.core.type.TypeReference;
import com.laolei.core.rest.HttpContext;
import com.laolei.core.rest.annotation.RestClient;
import com.laolei.core.rest.annotation.RestClient.I;
import com.laolei.test.api.model.YouDaoBasic;
import com.laolei.test.api.model.YoudaoRelust;

@RestClient(serverid = "youdao", version = "1.1", manuallyprocessed = I.YES, unpack = I.NO, path = "/openapi.do")
public class YoudaoApi {

	public YoudaoRelust<YouDaoBasic> fanyi(@RequestParam("q") String query, @RequestParam("keyfrom") String keyfrom,
			@RequestParam("key") String key, @RequestParam("type") String type,
			@RequestParam("doctype") String doctype) {
		return HttpContext.getBodyToObject(new TypeReference<YoudaoRelust<YouDaoBasic>>() {});
	};

	@RestClient(unpack = I.YES, packClass = YoudaoRelust.class, manuallyprocessed = I.NO, cache = I.YES)
	public YouDaoBasic fanyi1(@RequestParam("q") String query, @RequestParam("keyfrom") String keyfrom,
			@RequestParam("key") String key, @RequestParam("type") String type,
			@RequestParam("doctype") String doctype) {
		return null;
	};
}